﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PollDesigner/Editor.master" AutoEventWireup="true"
	Inherits="NosoiFigthersWeb.PollDesigner.ElementEdit" CodeBehind="ElementEdit.aspx.cs" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="head" ContentPlaceHolderID="head" runat="Server">
	<title>Poll designer - element edit</title>
</asp:Content>
<asp:Content ID="body" ContentPlaceHolderID="body" runat="Server">
	<table width="100%">
		<tr>
			<td width="50%">
				<table>
					<tr>
						<td>
							<h2>
								Edit element</h2>
							<table>
								<tr>
									<td width="20%">
										<asp:Panel ID="textPanel" runat="server" HorizontalAlign="Center">
											<asp:ImageButton ID="textButton" runat="server" ImageUrl="~/images/text.jpg" AlternateText="Text"
												OnClick="TextButton_Click" />
										</asp:Panel>
									</td>
									<td width="20%">
										<asp:Panel ID="singleChoicePanel" runat="server" HorizontalAlign="Center">
											<asp:ImageButton ID="singleChoiceButton" runat="server" ImageUrl="~/images/singlechoice.jpg"
												AlternateText="Single choice" OnClick="SingleChoiceButton_Click" />
										</asp:Panel>
									</td>
									<td width="20%">
										<asp:Panel ID="multiChoicePanel" runat="server" HorizontalAlign="Center">
											<asp:ImageButton ID="multiChoiceButton" runat="server" ImageUrl="~/images/multichoice.jpg"
												AlternateText="Multi choice" OnClick="MultiChoiceButton_Click" />
										</asp:Panel>
									</td>
									<td width="20%">
										<asp:Panel ID="openPanel" runat="server" HorizontalAlign="Center">
											<asp:ImageButton ID="openButton" runat="server" ImageUrl="~/images/open.jpg" AlternateText="Open"
												OnClick="OpenButton_Click" />
										</asp:Panel>
									</td>
									<td width="20%">
										<asp:Panel ID="numberPanel" runat="server" HorizontalAlign="Center">
											<asp:ImageButton ID="numberButton" runat="server" ImageUrl="~/images/number.jpg"
												AlternateText="Number" OnClick="NumberButton_Click" />
										</asp:Panel>
									</td>
								</tr>
								<tr>
									<td width="20%">
										<h4 align="center">
											Text</h4>
									</td>
									<td width="20%">
										<h4 align="center">
											Single choice</h4>
									</td>
									<td width="20%">
										<h4 align="center">
											Multi choice</h4>
									</td>
									<td width="20%">
										<h4 align="center">
											Open</h4>
									</td>
									<td width="20%">
										<h4 align="center">
											Number</h4>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td>
							<FCKeditorV2:FCKeditor ID="fckeditor" runat="server" BasePath="~/fckeditor/" ToolbarSet="Basic">
							</FCKeditorV2:FCKeditor>
						</td>
					</tr>
					<tr>
						<td>
							<asp:Panel ID="answersPanel" runat="server" Visible="False">
								<asp:Label ID="answersLabel" runat="server" Text="Answers:<br />"></asp:Label>
								<asp:ListView ID="answers" runat="server" ItemPlaceholderID="itemPlaceHolder" OnItemDataBound="Answers_ItemDataBound">
									<LayoutTemplate>
										<table width="100%">
											<asp:PlaceHolder ID="itemPlaceHolder" runat="server"></asp:PlaceHolder>
										</table>
									</LayoutTemplate>
									<ItemTemplate>
										<tr>
											<td width="60%">
												<asp:TextBox ID="answer" runat="server" Width="90%"></asp:TextBox>
											</td>
											<td align="right" width="30%">
												<asp:ImageButton ID="down" runat="server" AlternateText="down" ImageUrl="~/images/down.png"
													OnClick="Down_Click" ToolTip="down" />
												<asp:ImageButton ID="up" runat="server" AlternateText="up" ImageUrl="~/images/up.png"
													OnClick="Up_Click" ToolTip="up" />
												<asp:ImageButton ID="deleteAnswer" runat="server" AlternateText="delete" ImageUrl="~/images/trash.png"
													OnClick="DeleteAnswer_Click" ToolTip="delete" />
											</td>
										</tr>
									</ItemTemplate>
								</asp:ListView>
								<asp:LinkButton ID="addNewAnswer" runat="server" OnClick="AddNewAnswer_Click">add new answer</asp:LinkButton>
								<br />
							</asp:Panel>
							<asp:Panel ID="answersPropertiesPanel" runat="server" Visible="False">
								<asp:Label ID="answersPropertiesLabel" runat="server" Text="Answers properties:<br />"></asp:Label>
								<asp:CheckBox ID="obligatory" runat="server" Text="question is obligatory<br />" />
								<asp:Panel ID="answersCountExtremes" runat="server">
									<asp:DropDownList ID="minAnswersCount" runat="server">
									</asp:DropDownList>
									<asp:Label ID="minAnswersLabel" runat="server" Text="minimum answers given count<br />"></asp:Label>
									<asp:DropDownList ID="maxAnswersCount" runat="server">
									</asp:DropDownList>
									<asp:Label ID="maxAnswersLabel" runat="server" Text="maximum answers given count<br />"></asp:Label>
								</asp:Panel>
								<asp:RadioButtonList ID="arrangements" runat="server">
									<asp:ListItem Selected="True">answers arrangement horizontal</asp:ListItem>
									<asp:ListItem>answers arrangement vertical</asp:ListItem>
								</asp:RadioButtonList>
								<asp:Panel ID="valuesPanel" runat="server">
									<table>
										<tr>
											<td>
												<asp:Label ID="minValueLabel" runat="server">minimum value: </asp:Label>
											</td>
											<td>
												<asp:TextBox ID="minValue" runat="server"></asp:TextBox>
											</td>
											<td>
												<asp:RequiredFieldValidator ID="reqexMin" runat="server" ErrorMessage="number required"
													Display="Dynamic" ControlToValidate="minValue">
												</asp:RequiredFieldValidator>
												<asp:RegularExpressionValidator ID="regexMin" runat="server" ErrorMessage="number required"
													Display="Dynamic" ValidationExpression="[0-9]+" ControlToValidate="minValue">
												</asp:RegularExpressionValidator>
											</td>
										</tr>
										<tr>
											<td>
												<asp:Label ID="maxValueLabel" runat="server">maximum value: </asp:Label>
											</td>
											<td>
												<asp:TextBox ID="maxValue" runat="server"></asp:TextBox>
											</td>
											<td>
												<asp:RequiredFieldValidator ID="reqexMax" runat="server" ErrorMessage="number required"
													Display="Dynamic" ControlToValidate="maxValue">
												</asp:RequiredFieldValidator>
												<asp:RegularExpressionValidator ID="regexMax" runat="server" ErrorMessage="number required"
													Display="Dynamic" ValidationExpression="[0-9]+" ControlToValidate="maxValue">
												</asp:RegularExpressionValidator>
											</td>
										</tr>
									</table>
								</asp:Panel>
							</asp:Panel>
							<asp:Button ID="save" runat="server" Text="Save changes" OnClick="Save_Click" />
						</td>
					</tr>
				</table>
			</td>
			<td width="50%">
				<p align="center">
					<asp:Image ID="papirus" runat="server" ImageUrl="~/images/papirus.gif" Height="70%"
						Width="70%" />
				</p>
			</td>
		</tr>
	</table>
</asp:Content>
